<?php
/**
 * Created by PhpStorm.
 * User: eugene
 * Date: 2018/3/12
 * Time: 18:23
 */

namespace App\Transformers;


use App\Models\MyStage;

class StageTransformer extends Transformer
{
    public function transform($item)
    {
        return [
            'id'=>$item->StageID,
            'name'=>$item->StageName,
            'thumb'=>$item->StageImg,
            'short_desc'=>$item->shortDesc,
        ];
    }
    
    public function forSell($item)
    {
        return [
            'id'=>$item->StageID,
            'name'=>$item->StageName,
            'thumb'=>$item->StageImg,
            'desc'=>$item->StageIntr,
            'sell_price'=>$item->StagePrice,
            'hold'=>$item->hold?:0
        ];
    }
    
    public function forUser($item)
    {
        return [
            'id'=>$item->StageID,
            'name'=>$item->StageName,
            'thumb'=>$item->StageImg,
            'desc'=>$item->StageIntr,
            'hold'=>$item->hold?:0
        ];
    }
}